<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
    //https://developer.mozilla.org/en-US/docs/Glossary/Symbol

    //Most values in JavaScript support implicit conversion to a string.
    //For instance, we can alert almost any value, and it will work. Symbols are special. They don’t auto-convert.

    // let Sym = Symbol("Sym")
    /** ↓TypeError: Cannot convert a Symbol value to a string*/
    // alert(Sym)

    //That’s a "language guard" against messing up, because strings and symbols are fundamentally different, and should not occasionally convert one into another.

    //If you really want to show a symbol, we need to call .toString() on it.
    let Sym = Symbol("Sym");
    alert(Sym.toString());  // Symbol(Sym), now it works

    //Or you can use the symbol.description property to get its description:
    let _Sym = Symbol("Sym");
    alert(_Sym.description); // Sym
</script>
</body>
</html>